//引入各个组件
import Home from '@/pages/Home';
import Login from '@/pages/Login';
import Register from '@/pages/Register';
import Search from '@/pages/Search';
import Detail from '@/pages/Detail';
import AddCartSuccess from '@/pages/AddCartSuccess';
import Cart from '@/pages/Cart';
import Test from '@/pages/Test';

export default [
    {
        name: 'home',
        path: '/home',
        component: Home,
        meta:{showFooter:true}
    },
    {
        name: 'login',
        path: '/login',
        component: Login,
        meta:{showFooter:false}
    },
    {
        name: 'search',
        path: '/search',
        component: Search,
        meta:{showFooter:true}
    },
    {
        name: 'register',
        path: '/register',
        component: Register,
        meta:{showFooter:false}
    },
    {
        name:'detail',
        path:'/detail/:id',  //注意此处使用id占位
        props:true,
        component:Detail,
        meta:{showFooter:true}
    },
    {
        name:'addcart_success',
        path:'/addcart_success', 
        component:AddCartSuccess,
        meta:{showFooter:true}
    },
    {
        name:'cart',
        path:'/cart',  
        component:Cart,
        meta:{showFooter:true}
    },
     {
        name: 'test',
        path: '/test',
        component: Test,
        meta:{showFooter:true}
    },
    //重定向
    {
        path:'/',
        redirect:'/home'
    }
]